from django.db.migrations.graph import *
from django.db.migrations.loader import *
from django.db.migrations.recorder import *
from django.db.migrations import *
from django.apps import apps
from django.db import connection


# python .\manage.py runscript books.scripts.commands.migration_loader -v3
def run():
    migration_loader = MigrationLoader(connection)
    print(migration_loader.disk_migrations)
    key = ('auth', '0001_initial')
    print(migration_loader.disk_migrations[key])
    print(migration_loader.graph.node_map[key].children)
    recorder = MigrationRecorder(migration_loader.connection)
    print(recorder.applied_migrations())
